package com.liuyz;

/**
 * @author <a href="mailto:liuyaozong@gtmap.cn">liuyaozong</a>
 * @version 1.0, 2023/1/31
 * @description
 */
public class Test {

    public static void main(String[] args) {

        int j = 0;

        for (int i = 0; i < 5; i++) {
            System.out.println("i=" + i);
        }

        System.out.println("==============");

        for (; j < 5; ) {
            System.out.println("j=" + j);
            j++;
        }

        System.out.println("==================");

        test01();

    }

    // 标签的使用
    static private void test01() {

        for (int i = 0; i < 10; i++) {
            System.out.println("i=" + i);
            for (int j = 0; j < 5; j++) {
                System.out.println("j=" + j);
                break;
            }
        }

        System.out.println("\n---------------");

        test1:

        for (int i = 0; i < 10; i++) {
            System.out.println("i=" + i);
            for (int j = 0; j < 5; j++) {
                System.out.print("j=" + j);
                break test1;
            }
        }

    }

}
